package zenkml.core {
	import flash.display.Sprite;
	import flash.filters.DropShadowFilter;
	import flash.geom.Point;
	/**
	 * ...
	 * @author Zszen John
	 */
	public class Line extends Sprite{
		private var colorStart:Array = [0, 128, 255];
		private var colorEnd:Array = [255, 128, 0];
		private var lineThick:Number = 20
		private var pointOriginal:Point = new Point()
		public function Line() {
			//filters = [new DropShadowFilter(1,45,0x555555,1,2,2,2)]
		}
		public function clear():void {
			graphics.clear()
		}
		public function lineTo(point:Point, progress:Number = 0, isDraw:Boolean = true):void {
			var colorProgress:Array = [];
			for (var i:int = 0; i < 3; i++) {
				var unit:int = colorStart[i] + (colorEnd[i] - colorStart[i]) * progress
				colorProgress.push(unit)
			}
			var color:int = (colorProgress[0] << 16 | colorProgress[1] << 8 | colorProgress[2])
			if (isDraw) {
				graphics.lineStyle(lineThick, color,.8)
				graphics.lineTo(point.x-pointOriginal.x,point.y-pointOriginal.y)
			}else {
				pointOriginal = point
				graphics.moveTo(0,0)
			}
		}
	}
}